Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
Find element contains specific "path" attribute

Can someone please assist with the following issue?

I have map with more than 2000 elements loaded, but only one of them (which is currently visible) has the element 'path' with an attribute d different than zero. For easier understanding, refer to the following screenshot:

enter image description here

Tried with this: SVG & Path finding, but did not find what I was looking for.

And having this XPath:

//div[@id="map"]//div[contains(@class,"map")]//div[@class="leaflet-pane"]//div[@class="leaflet-pane2"]//*[name()='svg']//*[name()='path' and @d="M0 0"]

which finds all of them (2000).

What I am looking for is something like this (though I could not find the correct solution) - deliberately just added end of Xpath.

In summary, I need the d attribute (inside path) to not contain the value zero:

//*[name()='svg']//*[name()='path' and @d(contains,"125")]

Please assist, and thank you in advance.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

According to your descriptions you are looking for locator where d attribute value is not equals to M0 0.
This can be translated to XPath with not operator.
Please try this:

//div[@id="map"]//div[contains(@class,"map")]//div[@class="leaflet-pane"]//div[@class="leaflet-pane2"]//*[name()='svg']//*[name()='path' and(not(@d="M0 0"))]
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!